package com.lianbang.pharmacy.adapter

import androidx.databinding.DataBindingUtil
import cn.ubest.mvvmcore.base.BaseViewModel
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lianbang.pharmacy.R
import com.lianbang.pharmacy.databinding.ItemHomeListBinding

/**
 * Created by maoqi on 2020/11/21.
 */
class HomeItemListAdapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_home_list) {

    override fun onItemViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        super.onItemViewHolderCreated(viewHolder, viewType)
        DataBindingUtil.bind<ItemHomeListBinding>(viewHolder.itemView)
    }

    override fun convert(helper: BaseViewHolder, item: String) {
        val binding = helper.getBinding<ItemHomeListBinding>()
        helper.setImageResource(R.id.iv_img, R.drawable.hme_test)
            .setText(R.id.tv_title, "感冒发烧")
    }

}